package com.iotechn.unimall.data.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.iotechn.unimall.data.domain.CardDO;
import com.iotechn.unimall.data.domain.CardDO;
import com.iotechn.unimall.data.dto.CardDTO;
import com.iotechn.unimall.data.model.KVModel;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * Created by rize on 2019/7/4.
 */
public interface CardMapper extends BaseMapper<CardDO> {

    public Integer decCard(Long couponId);

    //这样写MyBatis无法直接映射泛型，只能用Long了
    public List<KVModel<Long,Long>> getUserCardsCount(@Param("userId") Long userId, @Param("cardIds") List<Long> cardIds);

    public List<CardDTO> getActiveCards();

    public List<CardDTO> getCardList(@Param("source") Integer source,@Param("title") String title, @Param("type") Integer type, @Param("cardUse") Integer cardUse,@Param("ids") List<Long> ids, @Param("offset") Integer offset, @Param("limit") Integer limit);

}
